﻿@using CommonMvc.Models.Sys
@{
   var MenuList = ViewBag.MenuList as List<Menu>;
 }
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>@ViewData["Title"] - CommonMvc</title>
    <environment include="Development">
        <link rel="stylesheet" href="~/css/layui.css" />
       

    </environment>    
</head>
<body class="layui-layout-body">
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script>
    <div class="container body-content">
        <div class="layui-layout layui-layout-admin">
            <div class="layui-header">
                <div class="layui-logo">layui 后台布局</div>
                <ul class="layui-nav layui-layout-right">
                    <li class="layui-nav-item">
                        <a href="javascript:;">
                            <img src="http://t.cn/RCzsdCq" class="layui-nav-img">
                            贤心
                        </a>
                        <dl class="layui-nav-child">
                            <dd><a href="">基本资料</a></dd>
                            <dd><a href="">安全设置</a></dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item"><a href="">退了</a></li>
                </ul>
            </div>
            <div class="layui-side layui-bg-black">
                <div class="layui-side-scroll">
                    <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
                    <ul class="layui-nav layui-nav-tree" lay-filter="test">
                        @foreach (Menu item in MenuList)
                        {
                            var seletedClass = "";
                            if (item.State == 1)
                            {
                                seletedClass = "layui-nav-itemed";
                            }
                            <li class="layui-nav-item @seletedClass">
                                <a class="" href="javascript:;">@item.Name</a>
                                <dl class="layui-nav-child">
                                    @if (item.ChilMenus != null && item.ChilMenus.Count > 0)
                                    {
                                        @foreach (Menu child in item.ChilMenus)
                                        {
                                            var seleteClass = "";
                                            if (child.State == 1)
                                            {
                                                seleteClass = "layui-this";
                                            }
                                            <dd><a href="@Url.Action(child.ActionName,child.ControllerName)" class="@seleteClass">@child.Name</a></dd>
                                        }
                                    }
                                </dl>
                            </li>
                        }
                    </ul>
                </div>
            </div>

            <div class="layui-body">
                <!-- 内容主体区域 -->
                <div style="padding: 15px;">
                    @RenderBody()
                </div>
            </div>

            <div class="layui-footer">
                <!-- 底部固定区域 -->
                © layui.com - 底部固定区域
            </div>

        </div>
        <hr />
        <footer>
            <p>&copy; 2018 - CommonMvc</p>
        </footer>
    </div>

    <environment include="Development">
        <script src="~/layui.all.js"></script>
    </environment>


    @RenderSection("Scripts", required: false)
</body>
</html>
